package com.example.customized.p1.p2;

import com.example.customized.apis.ExtendApi;
import com.example.customized.p1.p2.daos.UserMapper_p1;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;

@RestController
@RequestMapping("c1")
public class CustomizedController1 implements ExtendApi {

    @Autowired
    UserMapper_p1 userMapper_p1;

    /** 动态的 额外 扫描配置：提供新功能  */
    @GetMapping("/get")
    public Object get(){

        System.out.println( userMapper_p1.selectById(111) );
        return Arrays.asList("场景 1 执行 "+this.getClass().getName());
    }


    /** 动态的 额外 扫描配置：对原功能增强  */
    @Override
    public Object demo(Object... obj){
        return this.getClass().getName();
//        return null;
    }
}